<template>
	<div class="table-box">
		<ProTable ref="proTable" title="日志管理" :columns="columns" :requestApi="getLogList" selectId="userId"> </ProTable>
	</div>
</template>

<script setup lang="tsx" name="log">
import { ref } from 'vue';
import { ProTable } from '@/components';

import { ColumnProps } from '@/components/ProTable/interface';

import { getLogList } from '@/api/modules/sys';
// const globalStore = GlobalStore();

// 获取 ProTable 元素，调用其获取刷新数据方法（还能获取到当前查询参数，方便导出携带参数）
const proTable = ref();

// 表格配置项
const columns: ColumnProps[] = [
	{ prop: 'id', label: 'ID' },
	{ prop: 'key', label: '用户名', search: { el: 'input' }, isShow: false },
	{ prop: 'username', label: '用户名' },
	{ prop: 'operation', label: '用户操作' },
	{ prop: 'method', label: '请求方法' },
	{ prop: 'params', label: '请求参数' },
	{ prop: 'time', label: '请求时长(毫秒)' },
	{ prop: 'ip', label: 'IP地址' },
	{
		prop: 'createDate',
		label: '创建时间'
	}
];
</script>
